﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CreateContractV2.aspx.cs" Inherits="CreateContractV2" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
 <script type="text/javascript">
 
 
 /*以下均是客户信息相关*/ 
function OpenWindow(url)
        {
            // to handle in IE 7.0          
            if (window.showModalDialog)
            {      
                retVal = window.showModalDialog(url ,'newwindow',"dialogHeight:500px;dialogWidth:800px;resizable:no;center:yes;");
            }
            // to handle in Firefox
            else
            {     
                retVal = window.open(url,'newwindow','height=500,width=600,resizable=yes,modal=yes');
            }  
            //window.location.href=window.location.pathname+"?co_item_id="+co_item_id; 
            //alert(retVal);    
            var o=eval('('+retVal+')');
            //alert(o.name);
            document.getElementById('<%=textBoxClientID.ClientID%>').value=o.client_id;
            document.getElementById('<%=textBoxCorp_Name.ClientID%>').value=o.corp_name;
            document.getElementById('<%=textBoxConsigner.ClientID%>').value=o.consigner;
            document.getElementById('<%=textBoxFax.ClientID%>').value=o.fax;
            document.getElementById('<%=textBoxLinkman.ClientID%>').value=o.linkman;
            document.getElementById('<%=textBoxPhone.ClientID%>').value=o.phone;
            document.getElementById('<%=textBoxEmail.ClientID%>').value=o.email;
            
            return true;
        }
 function ResetClientInfo()
 {
            document.getElementById('<%=textBoxClientID.ClientID%>').value="";
            document.getElementById('<%=textBoxCorp_Name.ClientID%>').value="";
            document.getElementById('<%=textBoxConsigner.ClientID%>').value="";
            document.getElementById('<%=textBoxFax.ClientID%>').value="";
            document.getElementById('<%=textBoxLinkman.ClientID%>').value="";
            document.getElementById('<%=textBoxPhone.ClientID%>').value="";
            document.getElementById('<%=textBoxEmail.ClientID%>').value="";
 
 
 }
 
 function OpenPCAWindow(url)
        {
            // to handle in IE 7.0          
            if (window.showModalDialog)
            {      
                retVal = window.showModalDialog(url ,'newwindow',"dialogHeight:500px;dialogWidth:800px;resizable:no;center:yes;");
            }
            // to handle in Firefox
            else
            {     
                retVal = window.open(url,'newwindow','height=500,width=600,resizable=yes,modal=yes');
            }  
            //window.location.href=window.location.pathname+"?co_item_id="+co_item_id; 
            //alert(retVal);    
            var o=eval('('+retVal+')');
            //alert(o.name);
            document.getElementById('<%=textBox_PCA_ID.ClientID%>').value=o.PcaId;
            document.getElementById('<%=textBox_PName.ClientID%>').value=o.Pname;
            document.getElementById('<%=textBox_PModel.ClientID%>').value=o.Pmodel;
            document.getElementById('<%=textBox_PType.ClientID%>').value=o.Ptype;
            document.getElementById('<%=textBox_Guide_Price.ClientID%>').value=o.GuidePrice;
            document.getElementById('<%=textBox_PCA_Rem.ClientID%>').value=o.Rem;
           
            
            return true;
        }
 
 
</script>

    <h1 id="pagetitle" class="pagetitle">        
       合同编辑 <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <div class="anistyle" id="ani">
                    正在加载数据，请耐心等待...
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </h1>
    <strong>合同状态：<asp:Label ID="LabelContractStatus" runat="server" Text=""></asp:Label></strong>
    <strong>报告编号：</strong><asp:TextBox ID="txtSelfCode" runat="server" ToolTip="此编号可选，如果不输入的话，系统将自动生成。"></asp:TextBox>
    <strong>检测日期：</strong>
    <asp:TextBox ID="txtCheckDate" runat="server" ReadOnly="true"></asp:TextBox>
        <ajaxToolkit:CalendarExtender
    ID="CalendarExtender2"
    TargetControlID="txtCheckDate"
    PopupButtonID="txtCheckDate"
    Format="yyyy-MM-dd"
    runat="server"/>
        <table width="100%" border="1">
            <tr>
                <th rowspan="10" style="width: 57px">
                客户信息</th>
            </tr>
        <tr>
            <th style="width: 73px">
                客户编号</th>
            <td>
                <asp:TextBox ID="textBoxClientID" ReadOnly="true" runat="server"></asp:TextBox>
                *现有客户的唯一标识码.</td>
        </tr>
        <tr>
            <th style="width: 73px">
                客户单位</th>
            <td>
                <asp:TextBox ID="textBoxCorp_Name" runat="server" Width="208px"></asp:TextBox>
                *客户单位不可为空.</td>
        </tr>
              <tr>
            <th style="width: 73px">
                委托人姓名</th>
            <td>
                <asp:TextBox ID="textBoxConsigner" runat="server"></asp:TextBox>
                *委托人姓名不可为空.</td>
        </tr>
           <tr>
            <th style="width: 73px">
                通信地址</th>
            <td>
                <asp:TextBox ID="textBox_Addr" runat="server" Width="209px"></asp:TextBox></td>
        </tr>
             <tr>
            <th style="width: 73px">
                邮编</th>
            <td>
                <asp:TextBox ID="textBox_Postcode" runat="server"></asp:TextBox></td>
        </tr>
  
        <tr>
            <th style="width: 73px">
                联系人姓名</th>
            <td>
                <asp:TextBox ID="textBoxLinkman" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <th style="width: 73px">
                联系电话</th>
            <td>
                <asp:TextBox ID="textBoxPhone" runat="server" Width="126px"></asp:TextBox></td>
        </tr>
        <tr>
            <th style="width: 73px">
                传真</th>
            <td>
                <asp:TextBox ID="textBoxFax" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <th style="width: 73px">
                E-Mail</th>
            <td style="width: 230px">
                <asp:TextBox ID="textBoxEmail" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <th style="width: 73px">
                操作</th>
            <td style="width: 230px">
                <span id="BtnReset" runat="server">
                    <input id="Button1" type="button" value="重置" onclick="javascript:ResetClientInfo()" /></span>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                <%--<asp:Button ID="BtnReset" runat="server" Text="重置" OnClientClick= "javascript:ResetClientInfo()" />--%>
                <span id="BtnSelectClient" runat="server">
                    <input id="Button2" type="button" value="选择客户" onclick="javascript:OpenWindow('selectclientinfo.aspx')" /></span>&nbsp;<%--<asp:Button ID="BtnSelectClient" runat="server" Text="选择客户" OnClientClick="javascript:OpenWindow('selectclientinfo.aspx')"  />--%>
            </td>
        </tr>
 
    <tr>
    <th rowspan="8" style="width: 68px">产品信息</th>
    <th style="width: 86px">类别编号</th>
    <td><asp:TextBox ID="textBox_PCA_ID" runat="server"  ReadOnly="true" ></asp:TextBox></td>    
    </tr>
      <tr> 
    <th style="width: 86px">名称</th>
    <td><asp:TextBox ID="textBox_PName" runat="server"  ReadOnly="true" ></asp:TextBox></td>    
    </tr>
       <tr> 
    <th style="width: 86px">型号</th>
    <td><asp:TextBox ID="textBox_PModel" runat="server"  ReadOnly="true" ></asp:TextBox></td>    
    </tr>
      <tr> 
    <th style="width: 86px">参数标识</th>
    <td><asp:TextBox ID="textBox_PType" runat="server"  ReadOnly="true" ></asp:TextBox> </td>    
    </tr>
    <tr> 
    <th style="width: 86px">指导价格</th>
    <td><asp:TextBox ID="textBox_Guide_Price" runat="server"  ReadOnly="true" ></asp:TextBox></td>    
    </tr>
      <tr>       
    <th style="width: 86px">说明</th>
    <td><asp:TextBox ID="textBox_PCA_Rem" runat="server"></asp:TextBox></td>    
    </tr>     
       <tr>
    <th style="width: 86px">
        实际价格</th>
    <td><asp:TextBox ID="textBox_Charge" runat="server" BorderColor="Red" ValidationGroup="MKE" ></asp:TextBox>&nbsp;
        *请输入实际的合同价格，如50000.00.</td>    
    </tr>
    <tr> 
    <th style="width: 86px">操作</th>
    <td>  <input id="Button_Reset_PCA" type="button" value="重置" />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
        <input id="Button_Select_PCA" type="button"   value="选择产品"  onclick="javascript:OpenPCAWindow('selectpca.aspx')" /></td>    
    </tr>
    </table>
<p  style="text-align:center;">
    <asp:Button ID="Button_Save"  runat="server" OnClientClick='return confirm("您确认当前的客户信息和产品信息正确无误吗？\r\n注意：合同一旦确认创建，则相关信息未经授权不可更改。");' Text="签订合同" OnClick="Button_Save_Click" />
    <asp:Button  ID="Button_Save_Ex" runat="server" Visible="false" Enabled="false" Text="签订合同并送检"  OnClientClick='return confirm("您确认当前的客户信息和产品信息正确无误吗？\r\n注意：合同一旦确认创建，则相关信息未经授权不可更改。");' OnClick="Button_Save_Ex_Click"/>
   <asp:Button ID="Button_Cancel" runat="server" Text="取消"  OnClick="Button_Cancel_Click" />
   </p>
            <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server"
            TargetControlID="textBox_Charge"
            Mask="9999999.99"
            MessageValidatorTip="true"
            OnFocusCssClass="MaskedEditFocus"
            OnInvalidCssClass="MaskedEditError"
            MaskType="Number"
            InputDirection="RightToLeft"
            AcceptNegative="Left"
            DisplayMoney="Left"
            ErrorTooltipEnabled="True" 
            />
        <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
            ControlExtender="MaskedEditExtender2"
            ControlToValidate="textBox_Charge"
            IsValidEmpty="False"
            MaximumValue="9999999"
            EmptyValueMessage="数值不可为空"
            InvalidValueMessage="数值无效"
            MaximumValueMessage="数值 > 9999999"
            MinimumValueMessage="数值 < 0"
            MinimumValue="0"
            Display="Dynamic"
            TooltipMessage="输入的数值必需大于0，小于9999999"
            EmptyValueBlurredText="*"
            InvalidValueBlurredMessage="*"
            MaximumValueBlurredMessage="*"
            MinimumValueBlurredText="*"
            ValidationGroup="MKE" />
</asp:Content>

